home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / nihcl-30.lha / nihcl-3.0 / lib / Link.c < prev    next >
C/C++ Source or Header  |  1990-05-20  |  2KB  |  64 lines

  1. /* Link.c -- implementation of singly-linked list element
  2.  
  3.     THIS SOFTWARE FITS THE DESCRIPTION IN THE U.S. COPYRIGHT ACT OF A
  4.     "UNITED STATES GOVERNMENT WORK".  IT WAS WRITTEN AS A PART OF THE
  5.     AUTHOR'S OFFICIAL DUTIES AS A GOVERNMENT EMPLOYEE.  THIS MEANS IT
  6.     CANNOT BE COPYRIGHTED.  THIS SOFTWARE IS FREELY AVAILABLE TO THE
  7.     PUBLIC FOR USE WITHOUT A COPYRIGHT NOTICE, AND THERE ARE NO
  8.     RESTRICTIONS ON ITS USE, NOW OR SUBSEQUENTLY.
  9.  
  10. Author:
  11.     K. E. Gorlen
  12.     Bg. 12A, Rm. 2033
  13.     Computer Systems Laboratory
  14.     Division of Computer Research and Technology
  15.     National Institutes of Health
  16.     Bethesda, Maryland 20892
  17.     Phone: (301) 496-1111
  18.     uucp: uunet!nih-csl!kgorlen
  19.     Internet: kgorlen@alw.nih.gov
  20.     October, 1985
  21.  
  22. Function:
  23.     
  24. Link is an abstract class that is used to construct LinkedLists.  It
  25. contains a pointer to the next Link in the list, or nil if this is the
  26. last Link.
  27.  
  28. $Log:    Link.c,v $
  29.  * Revision 3.0  90/05/20  17:11:56  kgorlen
  30.  * Release for 1st edition.
  31.  * 
  32. */
  33.  
  34. #include "Link.h"
  35. #include "LinkOb.h"
  36.  
  37. #define    THIS    Link
  38. #define    BASE    Object
  39. #define BASE_CLASSES BASE::desc()
  40. #define MEMBER_CLASSES
  41. #define VIRTUAL_BASE_CLASSES Object::desc()
  42.  
  43. DEFINE_ABSTRACT_CLASS(Link,1,"$Header: /afs/alw.nih.gov/unix/sun4_40c/usr/local/src/nihcl-3.0/share/lib/RCS/Link.c,v 3.0 90/05/20 17:11:56 kgorlen Rel $",NULL,NULL);
  44.  
  45. extern const int NIHCL_DELLNK;
  46.  
  47. static LinkOb _nilLink;
  48. Link *const Link::nilLink = &_nilLink;
  49.  
  50. Link::~Link()
  51. {
  52.     if (next != NULL) setError(NIHCL_DELLNK,DEFAULT,className(),next,this);
  53. }
  54.  
  55. Object* Link::copy() const    { return deepCopy(); }
  56.  
  57. void Link::deepenShallowCopy()
  58. {
  59. }
  60.  
  61. Link::Link(OIOifd& fd) : BASE(fd) { next = NULL; }
  62.  
  63. Link::Link(OIOin& strm) : BASE(strm) { next = NULL; }
  64.